package com.goodluck.goodluckim.sdk.msg;

import com.goodluck.goodluckim.sdk.constant.MsgType;
import com.goodluck.goodluckim.db.model.CSMessage;

import java.io.File;

/**
 * 消息发送包装
 * Created by wyj on 2018/9/7.
 */
public class MessageBuilder {

    public static CSMessage createTextMessage(long sendId, String content, int sessionType) {
        CSMessage message = new CSMessage();
        message.setMessageContent(content);
        message.setSessionID(sessionType);
        message.setSenderUserId(sendId);
        message.setMessageType(MsgType.TEXT);
        message.setSendTime(System.currentTimeMillis());
        return message;
    }

    public static CSMessage createImageMessage(long sendId, String content, int sessionType, File imageFile) {
        CSMessage message = new CSMessage();
        message.setMessageContent(content);
        message.setSessionID(sessionType);
        message.setSenderUserId(sendId);
        message.setMessageType(MsgType.IMAGE);
        message.setSendTime(System.currentTimeMillis());
        return message;
    }

}
